package com.hello.sanyuan;

import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.widget.ImageView;

import com.hello.sanyuan.Units.OnLoadImageListener;

public class HelloActivity extends Activity{
	ProgressDialog dialog = null;


	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		final ImageView image = (ImageView)findViewById(R.id.image);

		new Units().loadImage(
						"http://daohang.gz-sanyuan.com/images/201207/thumb_img/2700_thumb_G_1343331674314.jpg",
						new OnLoadImageListener()
						{
							public void onLoadImage(Bitmap bm, String imageUrl)
							{
								if (null == bm)
								{
									image.setImageResource(R.drawable.ic_launcher);
								}else{
									image.setImageBitmap(bm);
								}
							}
						});
	}
}